package cn.edu.zafu.bigdata.yuyini;

class MathOperations {
    // 返回两个整数的和
    public int add(int a, int b) {
        return a + b;
    }

    // 返回两个浮点数的和
    public double add(double a, double b) {
        return a + b;
    }

    // 返回三个整数的和
    public int add(int a, int b, int c) {
        return a + b + c;
    }
}

public class MathOperations_Test {
    public static void main(String[] args) {
        MathOperations math = new MathOperations();

        // 调用add()方法，传入两个整数参数
        int sumInt = math.add(5, 20);
        System.out.println("Sum of two integers: " + sumInt);

        // 调用add()方法，传入两个浮点数参数
        double sumDouble = math.add(5.83, 10.5);
        System.out.println("Sum of two doubles: " + sumDouble);

        // 调用add()方法，传入三个整数参数
        int sumThreeInts = math.add(5, 15, 20);
        System.out.println("Sum of three integers: " + sumThreeInts);
    }
}

